package com.hopu.shop.dao.imp;

import com.hopu.shop.dao.SupportType;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@Repository("supportType")
public class SupportTypeimp implements SupportType {


    @Resource(name="sqlSessionTemplate")
    SqlSessionTemplate sqlSessionTemplate;


    //全查
    @Override
    public List<?> typequery(String str, Map map) throws Exception {
        return sqlSessionTemplate.selectList(str,map);
    }

    //修改
    @Override
    public int typeupd(String str, Map map) throws Exception {
        return sqlSessionTemplate.update(str,map);
    }

    //新增
    @Override
    public int typesava(String str, Map map) throws Exception {
        return sqlSessionTemplate.insert(str,map);
    }

    //删除
    @Override
    public int typedel(String str, Map map) throws Exception {
        return sqlSessionTemplate.delete(str,map);
    }


    //查询全部行数
    @Override
    public Map count(String str, Map map)throws  Exception {
        return  sqlSessionTemplate.selectOne(str,map);
    }
}
